<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>  
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>Vanade mängude uuesti esitamine</title>
	<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
	<link rel="stylesheet" type="text/css" href="gfx/styles_extra.css" />
	<script type="text/javascript" src="js/ajax.js"></script>
	<script type="text/javascript">
	$(function() {
		if(typeof(Storage) != "undefined") {
			if(typeof(localStorage.BSHIPS_gamesNumber) != "undefined") {
				for (var i = 0; i < parseInt(localStorage.BSHIPS_gamesNumber); i++) {
					$('.list').append("<tr><td class='number'>" + (i+1) + "</td><td><a href='replay.jsp?localGameId=" + String(i+1) + "' target='_blank'>" + "Mäng" +" ("+ String(i) +  ")</a></td></tr>");
				}
			}
		}
		else {
			alert("Teie brauser ei toeta local storage-t.");
		}
	});
	</script>
</head>
<body>
<div id="content">
	<h1>Sinu mängitud mängud</h1>
	<table class="list">
		<tr>
			<th class="number">Nr</th>
			<th>Mängitud mäng</th>
		</tr>
	</table>
</div>
</body>
</html>